const Base = require('./base.js');
const fs = require('fs');
const _ = require('lodash');
const moment = require('moment');
module.exports = class extends Base {
  async getListByGoodsIdAction() {
    const goodsId = this.get('goodsId') || ''
    const user = await this.model('order_goods')
    .field('u.*')
    .alias('g')
    .join({
      table: 'user',
      join: 'right',
      as: 'u',
      on: ['g.user_id', 'u.id']
    })
    .where({ goods_id: goodsId })
    .select();
    return this.success(user)
  }
};